<template >
  <div>
    <div style="width:100%;display:flex;color:#fff" class="divBox">
      <div style="width: 80%;">
        <a-card title="指令配置" style="width: 100%;text-align: center">
          <div class="configInstructionBox">
            <span style="font-size:16px;margin-right:20px">{{ instructionType }}:</span>
      

            <div
                class="instructionValueBox"
                v-if="instructionType.indexOf('加指令')!=-1||instructionType.indexOf('减指令')!=-1"
            >
              <a-input
                  v-if="instructionType.indexOf('频率')!=-1"
                  type="number"
                  v-model="instructionValue"
                  placeholder="Basic usage"
                  style="width: 200px;"
                  :min="0"
                  :max="14"
                  suffix="M"
              ></a-input>
              <a-input
                  v-else
                  type="number"
                  v-model="instructionValue"
                  placeholder="Basic usage"
                  style="width: 200px;"
                  :min="0"
                  :max="14"
              ></a-input>
              <a-icon
                  type="caret-up"
                  v-if="instructionType.indexOf('加指令')!=-1"
                  style="font-size:20px;margin-left:20px;cursor: pointer;"
                  @click="handleAddValue"
              />
              <a-icon
                  type="caret-down"
                  v-if="instructionType.indexOf('减指令')!=-1"
                  style="font-size:20px;margin-left:20px;cursor: pointer;"
                  @click="handleReduceValue"
              />
            </div>
          </div>
        </a-card>
  

        <a-card title="指令配置结果" style="width: 100%;text-align: center;">
          <div>
            <div>
              确定{{ instructionType }}是:
              <p
                  v-if="instructionType.indexOf('加指令')!=-1||instructionType.indexOf('减指令')!=-1"
              >{{ instructionValue }}</p>
              
              <p v-if="instructionType=='通联业务处理器L星弹链路频点控制'">
                频点号：
                <a-textarea :rows="2" v-model="pointInfo" style="width:550px"/>
              </p>
              <p v-if="instructionType=='通联业务处理器Ka星弹链路频点控制'">
                频点号：
                <a-textarea :rows="2" v-model="pointInfo" style="width:550px"/>
              </p>
              <div class="instructionValueBox" v-if="instructionType=='电磁感知处理器L可控接收机控制指令'">
                <a-form-model layout="inline" :model="formInline">
                  <a-form-model-item label="任务号">
                    <a-input read-only style="width: 120px" v-model="formInline.taskNo"
                             placeholder="请输入任务号"></a-input>
                  </a-form-model-item>
                  <a-form-model-item label="滤波器选通">
                    <a-input-number
                        style="width: 120px"
                        v-model="formInline.waveFilter"
                        placeholder="请输入滤波器选通最大2047"
                        :max="2047"
                        read-only
                    />
                  </a-form-model-item>
                  <a-form-model-item label="L可控接收机">
                    <a-select disabled v-model="formInline.LControllableReceiver" default-value="L可控接收机1"
                              style="width: 160px">
                      <a-select-option :value="0">L可控接收机1</a-select-option>
                      <a-select-option :value="1">L可控接收机2</a-select-option>
                    </a-select>
                  </a-form-model-item>
                </a-form-model>
              </div>
              <a-form-model layout="inline" :model="formInline" v-if="instructionType=='通用指令'"
              >
                <a-form-model-item>
                  <a-input read-only :maxLength="8" v-model="formInline.instructionValue"
                           placeholder="请输入4个十六进制数"></a-input>
                </a-form-model-item>
                <a-form-model-item>
                  <a-textarea style="width:300px" :rows="3" read-only :maxLength="68"
                              v-model="formInline.instructionValue1" placeholder="请输入34个十六进制数"></a-textarea>
                </a-form-model-item>
              </a-form-model>
              <a-form-model layout="inline" :model="formInline"   v-if="instructionType=='通联业务处理器接口及加解密模式控制'"
              >
                <a-form-model-item>
                  <a-input read-only :maxLength="8" v-model="formInline.instructionValue"
                           placeholder="请输入4个十六进制数"></a-input>
                </a-form-model-item>
              </a-form-model>
              <div class="instructionValueBox" v-if="instructionType=='加解密退网用户控制'||instructionType=='加解密入网用户控制'"
              >
                <a-form-model layout="inline" :model="formInline">
                  <a-form-model-item>
                    <a-textarea :rows="4" read-only v-model="formInline.instructionValue"
                                placeholder="请输入..."></a-textarea>
                  </a-form-model-item>
                </a-form-model>
              </div>
              <div class="instructionValueBox" v-if="instructionType=='通联业务处理器L星弹链路模式控制'||instructionType=='通联业务处理器Ka星弹链路模式控制'"
              >
                <a-form-model layout="inline" :model="formInline">
                  <a-form-model-item label="速率模式">
                    <a-select disabled v-model="formInline.rateMode" default-value="00" style="width: 160px">
                      <a-select-option value="00">下行3ksps</a-select-option>
                      <a-select-option value="11">下行12ksps</a-select-option>
                      <a-select-option value="22">下行24ksps</a-select-option>
                      <a-select-option value="33">下行48ksps</a-select-option>
                      <a-select-option value="44">下行96ksps</a-select-option>
                    </a-select>
                  </a-form-model-item>
                  <a-form-model-item label="下行频点号">
                    <a-select v-model="formInline.downlinkFrequencyPoint" default-value="00" style="width: 180px">
                      <a-select-option value="00">下行频点0（935MHz）</a-select-option>
                      <a-select-option value="11">下行频点1（940MHz）</a-select-option>
                      <a-select-option value="22">下行频点2（945MHz）</a-select-option>
                      <a-select-option value="33">下行频点3（950MHz）</a-select-option>
                      <a-select-option value="44">下行频点4（955MHz）</a-select-option>
                      <a-select-option value="55">下行频点5（960MHz）</a-select-option>
                      <a-select-option value="66">下行频点6（965MHz）</a-select-option>
                      <a-select-option value="77">下行频点7（970MHz）</a-select-option>
                      <a-select-option value="88">下行频点8（975MHz）</a-select-option>
                      <a-select-option value="99">下行频点9（980MHz）</a-select-option>
                      <a-select-option value="AA">下行频点10（985MHz）</a-select-option>
                    </a-select>
                  </a-form-model-item>
                </a-form-model>
              </div>
              <a-form-model v-if="instructionType=='星弹直传参数设置指令(SPU)'" layout="inline" :model="formInline">
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="接收拦截目标1信息的导弹数量">
                      <span style="color:#fff"> {{ formInline.ballNum }}</span>
                      <!-- <a-input-number read-only :max='32' v-model="formInline.ballNum" placeholder="请输入..."></a-input-number> -->
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <div>
                  <a-row v-for="(item,indx) in formInline.ballNum" :key="indx+'lanjie'">
                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'识别码'">
                        <a-input read-only v-model="params[indx].id1" placeholder="请输入..."></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'自定义配置区'">
                        <a-input read-only v-model="params[indx].area1" placeholder="请输入..."></a-input>
                      </a-form-model-item>
                    </a-col>

                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'拦截目标编号1'">
                        <a-input read-only v-model="params[indx].no1" placeholder="请输入..."></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'拦截目标编号2'">
                        <a-input read-only v-model="params[indx].no2" placeholder="请输入..."></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'的L/Ka标识'">
                        <a-select disabled v-model="params[indx].LKa" default-value="11" style="width: 180px">
                          <a-select-option value="AA">
                            KA标识
                          </a-select-option>
                          <a-select-option value="11">
                            L标识
                          </a-select-option>

                        </a-select>
                        <!-- <a-input v-model="params[indx].LKa" placeholder="请输入..."></a-input> -->
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                </div>

              </a-form-model>
              <a-form-model v-if="instructionType=='星车周期交互启动指令(SPU)'" layout="inline" :model="formInline">
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="武器平台识别码1">
                      <a-input read-only v-model="formInline.id1" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="星车交互启动指令码1">
                      <a-input read-only v-model="formInline.in1" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="武器平台识别码2">
                      <a-input read-only v-model="formInline.id2" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="星车交互启动指令码2">
                      <a-input read-only v-model="formInline.in2" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="武器平台识别码3">
                      <a-input read-only v-model="formInline.id3" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="星车交互启动指令码3">
                      <a-input read-only v-model="formInline.in3" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="武器平台识别码4">
                      <a-input read-only v-model="formInline.id4" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="星车交互启动指令码4">
                      <a-input read-only v-model="formInline.in4" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                </a-row>
              </a-form-model>
              <a-form-model layout="inline" v-if="instructionType=='星弹直传启动终止指令(SPU)'" :model="formInline">
                <a-row>
                  <a-form-model-item label="当前要启动直传的导弹总数量">
                          <span style="color:#fff">
                            {{ formInline.totalNum }}
                          </span>
                    <!-- <a-input-number v-model="formInline.totalNum" placeholder="请输入"></a-input-number> -->
                  </a-form-model-item>
                </a-row>

                <a-form-model-item :key="index" v-for="(item,index) in formInline.totalNum"
                                   :label="'导弹'+(index+1)+'识别码'">
                  <a-input read-only v-model="idCa[index]" placeholder="请输入"></a-input>
                </a-form-model-item>
              </a-form-model>
              <div class="instructionValueBox" v-if="instructionType=='通联综合控制器导弹识别码设置指令'">
                <a-form-model layout="inline" :model="formInline">
                  <a-form-model-item label="有效填充1">
                    <a-input read-only v-model="formInline.instructionValue" placeholder="请输入..."></a-input>
                  </a-form-model-item>
                  <a-form-model-item label="导弹识别码">
                    <a-input read-only v-model="formInline.instructionValue1" placeholder="请输入..."></a-input>
                  </a-form-model-item>
                </a-form-model>
              </div>
              <div class="instructionValueBox"  v-if="instructionType=='星车对时指令TISU端'||instructionType=='通联综合控制器星地对时'">
                <a-form-model layout="inline" :model="formInline">
                  <a-form-model-item label="指令长度">
                    <a-input read-only v-model="formInline.instructionValue" placeholder="请输入..."></a-input>
                  </a-form-model-item>
                  <a-form-model-item label="指令内容">
                    <a-input read-only v-model="formInline.instructionValue1" placeholder="请输入..."></a-input>
                  </a-form-model-item>
                </a-form-model>
              </div>
              <a-form-model layout="inline" v-if="instructionType=='星车对时指令TSPU端'" :model="formInline">
                <a-form-model-item label="指控车识别码">
                  <a-input v-model="formInline.carName" placeholder="请输入..."></a-input>
                </a-form-model-item>

              </a-form-model>
              <div class="instructionValueBox" v-if="instructionType=='通联业务处理器星指链路模式控制'">
                <a-form-model
                    layout="inline"
                    :model="formInline"
                    :label-col="labelCol"
                    :wrapper-col="wrapperCol"
                >
                  <a-row>
                    <a-col :span="8">
                      <a-form-model-item label="上行速率模式">
                        <a-select disabled v-model="formInline.uplinkRateMode" default-value="00" style="width: 180px">
                          <a-select-option value="0000">上行640kbps</a-select-option>
                          <a-select-option value="1111">上行1280kbps</a-select-option>
                        </a-select>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span="8">
                      <a-form-model-item label="下行速率模式">
                        <a-select disabled v-model="formInline.downlinkRateMode" default-value="0000"
                                  style="width: 180px">
                          <a-select-option value="0000">下行3.2Mbps</a-select-option>
                          <a-select-option value="1111">下行6.4Mbps</a-select-option>
                        </a-select>
                      </a-form-model-item>
                    </a-col>

                  </a-row>

                  <a-row>
                    <a-col :span="8">
                      <a-form-model-item label="上行跳频控制">
                        <a-select disabled v-model="formInline.uplinkFrequencyHoppingControl" default-value="0000"
                                  style="width: 180px">
                          <a-select-option value="0000">上行定频（960MHz）</a-select-option>
                          <a-select-option value="1111">上行跳频</a-select-option>
                        </a-select>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span="8">
                      <a-form-model-item label="下行跳频控制">
                        <a-select v-model="formInline.downlinkFrequencyHoppingControl" disabled default-value="0000"
                                  style="width: 180px">
                          <a-select-option value="0000">下行定频（960MHz）</a-select-option>
                          <a-select-option value="1111">下行跳频</a-select-option>
                        </a-select>
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                  <a-row>
                    <a-col :span="8">
                      <a-form-model-item label="工作模式">
                        <a-select disabled default-value="00" v-model="formInline.workingMode" style="width: 180px">
                          <a-select-option value="00">交换工作模式</a-select-option>
                          <a-select-option value="FF">自测环境模式</a-select-option>
                        </a-select>
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                </a-form-model>
              </div>
            </div>
            <a-button
                type="primary"
                @click="generateInstructionContent()"
            >生成指令内容
            </a-button>
          </div>
        </a-card>
      </div>
      <div style="width: 20%">
        <a-descriptions title="遥测信息" style="width: 25%；color:#fff" size="small" :column="1">

          <a-descriptions-item :label="item.label" v-for="item in descList" :key="item.label">
            {{ item.value }}
          </a-descriptions-item>
        </a-descriptions>
      </div>


    </div>
  </div>
</template>
<script>
export default {
  props: {
    instructionType: {
      type: String,
      default: 'L可控接收机1本振加指令'
    },
  },
  data(){
    return{
      instructionValue:"",
      descList:[],
    }
  },
  methods: {
    
    handleAddValue() {
      this.instructionValue += 1
    },
    handleReduceValue() {
      this.instructionValue -= 1
    },
  },
}
</script>
<style lang="less" scoped>
  
</style>
